
package squarePackage;

import java.util.List;


/**
 * An interface of teleporters for creating teleport squares.
 * A teleporter can teleport the avatar on it to one of its destinations
 * 
 * @invar   ...
 * 			|this.isValidDestinationList(this.getDestinationList()) == true;
 * 
 * @version  2.0
 * @author   An
 */
public interface Teleport extends Square {
	
	
	/**
	 * A method to get a list of possible destinations of this teleporter
	 * 
	 * @return a list of possible destinations of this teleportes
	 * 
	 */
	abstract List<SquareImp> getDestinationList();

	/**
	 * A method to set the list of possible destinations of this teleporter
	 * 
	 * @param destinationList
	 * 		  the list of destinations you wish to set
	 * @post ...
	 * 		| new.getDestinationList() = destinationList;
	 */
	abstract void setDestinationList(List<SquareImp> destinationList);
	
	/**
	 * A method to check whether or not a list of destinations is valid
	 * 	for this teleporter
	 * 
	 * @param destinationList
	 * 			the list of destinations you wish to check
	 * @return true if this is a valid list of destinations
	 * 		   |...
	 */
	boolean isValidDestinationList(List<SquareImp> destinationList);
	
	/**
	 * A method to check whether or not a Destination is valid for this teleporter
	 * 
	 * @param square
	 * 			the square you wish to check as destination
	 * @return true if this square is a valid destination
	 * 		   |...
	 */
	abstract boolean isValidDestination(SquareImp square);
	
	/**
	 * A method to set a square as destination for this teleporter
	 * 
	 * @param square
	 * 			the square you wish to set as destination
	 * @post ...
	 * 		 |new.hasDestination(square) == true;
	 */
	abstract void setDestination(SquareImp square);
	
	/**
	 * A method to choose a random destination from the destinationlist from this teleporter
	 * 
	 * @return a random destination from the destinationlist from this teleporter
	 */
	abstract Square chooseRandomDestination();
	
	/**
	 * A method to check whether or not this teleporter has a certain destination
	 * 
	 * @param destination
	 * 			the destination you wish to check
	 * @return ...
	 * 		   | this.getDestinationList().contains(destination)
	 */
	abstract boolean hasDestination(SquareImp destination);
}
